// https://qc2rok.api.cloudendpoint.cn/insert?v=0.1

module.exports = async function(params, context){
  const v = Number.parseFloat(params.v)
  if(0<=v && v<=1){
      const rands = inspirecloud.db.table('rands');
      const result = await rands.save({value: v});
      if(result) return {code: 0}
  }
  return {code: 1}
}